package cn.seamus.marksman.processor.impl;

import java.net.URL;
import java.util.Map;
import java.util.concurrent.Callable;

import org.apache.http.client.methods.CloseableHttpResponse;

import cn.seamus.marksman.http.IHttpExecuter;

public class HttpCallable implements Callable<CloseableHttpResponse> {
    private IHttpExecuter executer;
    private URL url;
    private Map<String, Object> params;

    public HttpCallable(IHttpExecuter executer, URL url, Map<String, Object> params) {
        this.executer = executer;
        this.url = url;
        this.params = params;
    }

    @Override
    public CloseableHttpResponse call() throws Exception {
        return executer.executePost(url, params);
    }

}